@mixin overflowText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@mixin flex($align: null, $justify: null)  {
  display: flex;
  justify-content: $justify;
  align-items: $align;
  @content;
}

.tree-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--el-assets-bg-color);

  .tree-type {
    transition: all .3s;

    .tree-type-banner {
      position: relative;
      display: flex;
      height: 31px;
      line-height: 31px;
      padding-right: 11px;
      padding-left: 15px;
      overflow: hidden;
      text-overflow: ellipsis;
      color: var(--el-menu-text-color);
      border-bottom: 1px solid var(--el-assets-border-bottom-color);
      border-right: 1px solid var(--el-assets-border-right-color);
      background-color: var(--el-assets-fold-item-bg-color);

      .tree-banner-left {
        cursor: pointer;
        flex: 1;
        @include flex(center);
        @include overflowText;

        .tree-icon-rotate {
          @include flex(center);
          height: 30px;
          padding-top: 3px;
          padding-right: 3px;
          font-size: 16px;
          color: var(--el-menu-text-color);
        }

        .tree-type-banner-label {
          margin-left: 7px;
          padding-top: 2px;
          font-size: 13px;
          cursor: pointer;
          @include overflowText;
        }
      }

      .tree-banner-icon-zone {
        @include flex(center);

        // todo)) 未找到对应的
        .disabled {
          pointer-events: none;
          opacity: 0.6;
        }

        // 刷新按钮不需要 padding-right
        .fa-refresh.tree-banner-icon {
          padding-right: 0;
          margin-top: 2px;
        }

        // 批量操作按钮需要给一些 padding-top 使得看上去垂直居中
        .fa-square-o.tree-banner-icon {
          padding-top: 2px;
        }

        .fa-check-square.tree-banner-icon {
          padding-top: 2px;
        }

        .tree-banner-icon {
          @include flex(center);
          width: 20px;
          height: 100%;
          padding: 0 5px;
          cursor: pointer;
          color: var(--el-assets-icon-color);

          &:hover {
            cursor: pointer;
            color: #ffffff;
            font-weight: bold;
          }
        }

        .tree-search {
          @include flex(center);
          position: relative;
          transition: .25s;
          overflow: hidden;

          .tree-input {
            opacity: 0;
            width: 0;
            line-height: 20px;
            background-color: var(--el-assets-bg-color);
            border: none;
            outline: none;
            border-radius: 10px;
            color: var(--el-menu-text-color);
            transition: all .4s ease-in-out;
          }

          &.active {
            .fa-search {
              position: absolute;
              left: 5px;
            }

            .tree-input {
              @include flex(center);
              opacity: 1;
              width: 130px;
              padding-left: 30px;
            }
          }
        }
      }


      .rotate {
        transform: rotate(-90deg);
      }

      .show {
        display: none;
      }
    }

    .tree-type-content {
      position: relative;
      padding: 5px 10px;
      min-height: 40px;
      overflow-x: auto;
      height: calc(100% - 31px);
      background-color: var(--el-assets-extend-bg-color);

      .tree-type-loading {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        min-height: 100%;
        background: rgba(0, 0, 0, .1);
        @include flex(center, center);
      }


      .ztree {
        height: 100%;
        background-color: var(--el-assets-extend-bg-color);
      }
    }

    &.expand-tree {
      height: calc(100% - 31px);
    }
  }
}

.tree-refresh .fa {
  width: 24px;
  height: 24px;
  line-height: 24px;
  background-size: 18px;
  background-position: 3px 3px;
  margin-left: -30px;
  position: absolute;
  margin-right: 10px;
  text-align: center;
  display: inline-block;
  font: normal normal normal 14px/1 FontAwesome !important;
}

.view-menu {
  position: absolute;
  margin: 0;
  padding: 6px 0;
  opacity: 1;
  user-select: none;
  border: none;
  border-radius: 2px;
  -webkit-border-radius: 2px;
  -webkit-user-select: none;
  -moz-border-radius: 2px;
  -moz-user-select: none;
  -ms-user-select: none;
  background-color: var(--el-rMenu-bg-color);
  box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.16);
  z-index: 1000;

  tr {
    margin: 0;
  }

  td {
    display: block;
    padding: 0 15px;
    text-decoration: none;
    min-width: 150px;
    width: auto;
    opacity: 1;
    white-space: nowrap;
    line-height: 24px;
    text-shadow: none;
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    border-radius: 0;
    cursor: pointer;
  }
}

.view-menu, .view-menu * {
  box-sizing: border-box;
}

.view-menuContainer {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: 1000;
  -webkit-tap-highlight-color: transparent;
}

.view-menu__item {
  cursor: pointer;
  padding: 0 6px;
}


.view-menu__icon {
  padding-right: 5px;
  width: 15px;
}

.view-menu__item.view-menu__item--separator {
  background: #181414;
  border: 0;
  border-top: none;
  height: 1px;
  min-height: 1px;
  max-height: 1px;
  padding: 0;
  border-left: none;
  text-shadow: 0 0 0 transparent;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
  margin: 2px 0;
}

tr {
  display: table-row;
  vertical-align: inherit;
  border-color: inherit;
}

tr:hover {
  background-color: var(--el-rMenu-hover-bg-color);
}

.view-menu table {
  border-spacing: 0 !important;
}

.view-menu__data {
  padding: 0 6px;
}

.open-tree {
  flex: 1;
}

